package com.briup.ch10;

/**
 * @author yuxi
 * @version 1.0
 * @date 2025/10/11
 * @Description:
 */
public class Test05 {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread());
        System.out.println(Thread.currentThread().getName());
        System.out.println(Thread.currentThread().getThreadGroup());

        ThreadGroup group=new ThreadGroup("线程组1");
        Thread t1=new Thread(group,"t1"){
            @Override
            public void run(){
                System.out.println(getName()+getThreadGroup());
                Thread t2=new Thread(new ThreadGroup("线程组2"),"t2"){
                    public void run(){
                        System.out.println(getName()+getThreadGroup());
                    }
                };
                t2.start();
            }

        };
        t1.start();

    }
}
